﻿//正在加载中
function LoadingDocument(obj) {
    if (obj == null || obj == "" || obj == undefined) {
        obj = $("#divContent");
    }
    $(obj).html("<div style='text-align:center;'>数据加载中...</div>");
};

//获取客户端接口
function GetExternal() {
    return window.external.EmObj
};

//调用客户端接口
function PC_JH(type, c) {
    try {
        var obj = GetExternal();
        return obj.EmFunc(type, c)
    } catch (e) { }
};

//页面加载完成
function EM_FUNC_DOWNLOAD_COMPLETE() {
    try { PC_JH("EM_FUNC_DOWNLOAD_COMPLETE", ""); }
    catch (ex) { }
};

//个股
function GoKLine(stock) {
    if (stock.length == 6) {
        if (parseInt(stock) < 600000) {
            stock = "1" + stock;
        }
    }
    var par = "455," + stock;
    try {
        PC_JH("EM_FUNC_GOTO_TECH_VIEW", par)
    } catch (err) { }
    return false;
};

//板块
function GoBKLine(code) {
    if (code.length == 4) {
        code = "BK" + code;
    }
    var par = "455," + code;
    try {
        PC_JH("EM_FUNC_GOTO_TECH_VIEW", par)
    } catch (err) { }
    return false
};

//设置页面大小
function EM_FUNC_DLGSIZE(size) {
    try { PC_JH("EM_FUNC_DLGSIZE",size); }
    catch (ex) { }
};

//下发股票
function EM_FUNC_AGEVENT_GETGOODS(goods) {
    try { PC_JH("EM_FUNC_AGEVENT_GETGOODS", goods); }
    catch (ex) { }
};

//获取行情
function EM_FUNC_AGEVENT_PUSHDATA() {
    var data = "";
    //data = "{\"data\":[{\"code\":600679,\"p\":\"13.72\",\"zdf\":\"0.44%\"},{\"code\":600679,\"p\":\"13.72\",\"zdf\":\"0.44%\"}],\"ver\":1}";
    try {
        data = PC_JH("EM_FUNC_AGEVENT_PUSHDATA", "");
    }
    catch (ex) {
    }
    return data;
};

